.app {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: 100vh;
  /* 清新浅色系背景 */
  background: linear-gradient(135deg, 
                #e3f2fd 0%,     /* 浅蓝 */
                #f1f8e9 35%,    /* 浅绿 */
                #ffffff 70%,    /* 白色 */
                #e8f5e9 100%);  /* 淡绿 */
  font-family: 'Arial', '微软雅黑', sans-serif;
  overflow-x: auto;
  box-sizing: border-box;
}

h1 {
  color: #1976d2;  /* 深蓝色 */
  font-size: 3em;
  margin: 20px 0;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1),
               0 0 10px rgba(25, 118, 210, 0.2);
  font-weight: bold;
  letter-spacing: 8px;
}

.game-info {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 30px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08),
              0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(25, 118, 210, 0.2);
  min-width: 520px;
  text-align: center;
}

.status {
  font-size: 1.5em;
  margin-bottom: 15px;
  font-weight: bold;
  color: #333;
}

.player {
  padding: 5px 15px;
  border-radius: 6px;
  margin: 0 5px;
}

.player.red {
  background: #ff4444;
  color: white;
}

.player.black {
  background: #333;
  color: white;
}

.check {
  color: #ff6b00;
  animation: blink 1s infinite;
}

.winner {
  color: #ffd700;
  font-size: 1.3em;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.controls {
  display: flex;
  gap: 15px;
  justify-content: center;
}

button {
  padding: 12px 24px;
  font-size: 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #64b5f6 0%, #42a5f5 100%);
  color: white;
  cursor: pointer;
  transition: all 0.3s;
  font-weight: bold;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  background: linear-gradient(135deg, #90caf9 0%, #64b5f6 100%);
}

button:active:not(:disabled) {
  transform: translateY(0);
}

button:disabled {
  background: #e0e0e0;
  cursor: not-allowed;
  opacity: 0.6;
  color: #9e9e9e;
}

.instructions {
  background: rgba(255, 255, 255, 0.95);
  padding: 20px 30px;
  border-radius: 12px;
  margin-top: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08),
              0 2px 4px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(25, 118, 210, 0.2);
  max-width: 520px;
}

.instructions h3 {
  color: #1976d2;
  margin-top: 0;
  font-size: 1.3em;
  border-bottom: 2px solid rgba(25, 118, 210, 0.2);
  padding-bottom: 10px;
}

.instructions ul {
  text-align: left;
  color: #424242;
  line-height: 1.8;
}

.instructions li {
  margin: 8px 0;
}

/* 游戏模式选择 */
.mode-selection {
  background: rgba(255, 255, 255, 0.98);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1),
              0 4px 8px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(25, 118, 210, 0.15);
  max-width: 600px;
}

.mode-selection h2 {
  color: #1976d2;
  margin-bottom: 30px;
  font-size: 2em;
  text-align: center;
  border-bottom: 3px solid rgba(25, 118, 210, 0.2);
  padding-bottom: 15px;
}

.mode-buttons {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
}

.mode-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 20px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  border: 2px solid rgba(25, 118, 210, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  color: #1565c0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.mode-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  background: linear-gradient(135deg, #90caf9 0%, #64b5f6 100%);
  color: white;
}

.mode-icon {
  font-size: 4em;
  margin-bottom: 15px;
}

.mode-title {
  font-size: 1.5em;
  font-weight: bold;
  margin-bottom: 10px;
}

.mode-desc {
  font-size: 0.9em;
  opacity: 0.9;
}

.ai-settings {
  background: rgba(227, 242, 253, 0.5);
  padding: 20px;
  border-radius: 12px;
  border: 1px solid rgba(25, 118, 210, 0.2);
}

.ai-settings h3 {
  color: #1976d2;
  margin-top: 0;
  margin-bottom: 15px;
  font-size: 1.2em;
  border-bottom: 2px solid rgba(25, 118, 210, 0.2);
  padding-bottom: 8px;
}

.setting-group {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
  gap: 10px;
}

.setting-group:last-child {
  margin-bottom: 0;
}

.setting-group label {
  color: #1565c0;
  font-weight: bold;
  min-width: 80px;
}

.setting-group select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(25, 118, 210, 0.3);
  border-radius: 8px;
  background: white;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
  color: #424242;
}

.setting-group select:hover {
  border-color: #42a5f5;
  background: rgba(227, 242, 253, 0.3);
}

.setting-group select:focus {
  outline: none;
  border-color: #1976d2;
  box-shadow: 0 0 8px rgba(25, 118, 210, 0.2);
}

.thinking {
  color: #ff6b00;
  font-style: italic;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .app {
    padding: 10px;
    overflow-x: hidden;
  }

  h1 {
    font-size: 2em;
    letter-spacing: 4px;
    margin: 10px 0;
  }

  .game-info {
    min-width: unset;
    width: 100%;
    max-width: 100%;
    padding: 15px;
    box-sizing: border-box;
  }

  .status {
    font-size: 1.2em;
  }

  .controls {
    flex-wrap: wrap;
    gap: 10px;
  }

  button {
    padding: 10px 16px;
    font-size: 14px;
    flex: 1;
    min-width: 80px;
  }

  .instructions {
    max-width: 100%;
    width: 100%;
    padding: 15px;
    box-sizing: border-box;
  }

  .instructions h3 {
    font-size: 1.1em;
  }

  .instructions ul {
    font-size: 0.9em;
    padding-left: 20px;
  }

  .mode-selection {
    padding: 20px;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .mode-selection h2 {
    font-size: 1.5em;
  }

  .mode-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .mode-btn {
    padding: 20px;
  }

  .mode-icon {
    font-size: 3em;
  }

  .mode-title {
    font-size: 1.3em;
  }

  .ai-settings {
    padding: 15px;
  }

  .setting-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }

  .setting-group label {
    min-width: unset;
  }

  .setting-group select {
    width: 100%;
  }
}
